package com.example.neusoft.yuejian_tea;

import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class FirstActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_first);
        SharedPreferences sp=getSharedPreferences("first",MODE_PRIVATE);
        SharedPreferences.Editor editor=sp.edit();
        Boolean isfirst=sp.getBoolean("first",true);
        if(isfirst)
        {
            Intent intent=new Intent(FirstActivity.this,GuideActivity.class);
            startActivity(intent);
            editor.putBoolean("first",false);
            editor.commit();
            finish();
        }
        else
        {
            Intent intent=new Intent(FirstActivity.this,WelcomeActivity.class);
            startActivity(intent);
            finish();
        }

    }
}
